import { ACCESS_TOKEN, REFRESH_TOKEN } from "@/global/constants"
import { localCache } from "@/utils/cacheData"

// 存储短token
export const setAccessToken = (token: string) => {
  localCache.setCache(ACCESS_TOKEN, token)
}
// 存储长token
export const setRefreshToken = (token: string) => {
  localCache.setCache(REFRESH_TOKEN, token)
}
// 获取短token
export const getAccessToken = () => {
  return localCache.getCache(ACCESS_TOKEN)
}
// 获取长token
export const getRefreshToken = () => {
  return localCache.getCache(REFRESH_TOKEN)
}
// 删除短token
export const removeAccessToken = () => {
  localCache.removeCache(ACCESS_TOKEN)
}
// 删除长token
export const removeRefreshToken = () => {
  localCache.removeCache(REFRESH_TOKEN)
}
